home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / COMMUNIC / KERM313.ZIP / MODEMS / PP14400.SCR < prev    next >
Text File  |  1993-07-07  |  5KB  |  128 lines

  1. ; FILE PP14400.SCR (MSMPP144.SCR)
  2. ;
  3. ; An MS-DOS Kermit script program for dialing the Practical Peripherals
  4. ; 14400 modem, to be used with MS-DOS Kermit 3.11 or later.
  5. ; The modem is set up for compression, error correction, all types of fallback.
  6. ; RTS/CTS flow control, fixed interface speed of 57600 or 38400.
  7. ;
  8. ; Authors: Christine M. Gianone, Frank da Cruz; Columbia U, June 1993
  9. ;
  10. def errfail echo \%1, hangup, goto fail ; Macro to handle failures.
  11. if < VERSION 312 errfail {MS-DOS Kermit 3.12 or later required.}
  12. if eq "\v(system)" "UNIX" if = \v(local) 0 stop 1 You must SET LINE first
  13.  
  14. define chkerr if fail stop 1 \%1
  15. define chkok input 3 OK, if fail stop 1 \%1
  16.  
  17. set input echo on        ; So we can watch what happens.
  18. set input timeout proceed       ; Allow IF SUCCESS, IF FAILURE.
  19. set input case ignore        ; Use caseless string comparisons
  20.  
  21. set parity none            ; Avoid parity foulups
  22. set flow none            ; Avoid flow control deadlocks
  23. hangup                ; Begin by dropping DTR
  24. pause 1                ; for one second
  25.  
  26. ; Speed.  Don't worry about modem, it autobauds up to 14400.
  27.  
  28. set speed 57600            ; If computer can be set to 57600 bps, use it.
  29. if fail set speed 38400        ; If not, use 38400.
  30.  
  31. echo Configuring Practical Peripherals 14400 on \v(line).
  32.  
  33. wait 0 DSR            ; Check modem signals that should be on
  34. chkerr {No DSR signal - check your modem and cable}
  35. wait 0 CTS
  36. chkerr {No CTS signal - check your modem and cable}
  37.  
  38. :INIT
  39. output ATQ0V1\13        ; Enable word result codes
  40. chkok {Can't get modem's attention}
  41.  
  42. output AT E1 W1 S95=47 X4\13    ; Echoing, result codes, etc.
  43. chkok {Can't initialize modem}
  44.  
  45. echo Enabling modulation negotiation...
  46. output AT S37=11 N1\13        ; Start modulation speed negotiation at V32bis
  47. chkok {Can't enable modulation speed negotiation}
  48. echo Enabling hardware flow control...
  49. output AT &K3\13        ; RTS/CTS hardware flow control
  50. chkok {Can't enable RTS/CTS}    ; On modem
  51. set flow rts/cts        ; And in Kermit too, but only now
  52. echo Configuring modem to ignore BREAK...
  53. output AT S82=128\13        ; Make modem ignore BREAK
  54. chkok {Can't become transparent to BREAK}
  55. echo Enabling error correction and data compression...
  56. output AT &Q5 S36=7 S46=2\13    ; Enable error correction & compression
  57.                 ; with automatic speed buffering 
  58. chkok {Can't enable compression EC and fallback}
  59.  
  60. if def \%1 if not equal "\%1" "=" goto BEGIN
  61. echo Modem initialization complete, no number to dial
  62. end 0
  63.  
  64. :BEGIN                ; Now DIAL.
  65. clear                ; Clear INPUT buffer.
  66. set count 5                     ; Dialing retry counter, 5 tries allowed.
  67. echo Dialing \%1 on \v(line) at \v(speed) bps, wait...
  68. echo
  69. pause 1
  70. goto dial                       ; 1st time, skip pause and Redialing message
  71.  
  72. :REDIAL
  73. set alarm 30
  74. pause 30            ; Wait 30 seconds before redialing.
  75. if not alarm errfail {Dialing canceled.}
  76. echo Redialing...               ; Message for redialing.
  77. pause 1
  78.  
  79. :DIAL
  80. output ATD\%1\13                ; Dial the number.
  81. set alarm 90            ; (For detecting keyboard interruptions.)
  82. if > VERSION 312 clear input    ; Clear echo from INPUT buffer.
  83. if < VERSION 313 clear
  84. input 30 \10                    ; Wait for the linefeeds...
  85.  
  86. :GETMSG
  87. input 60 \10            ; ...that surround the response message.
  88. if success goto gotmsg        ; Got a message.
  89. if alarm errfail {No response from modem.} ; No response in 90 seconds.
  90. hangup                ; User interrupted from keyboard,
  91. output \13            ; cancel dialing by sending carriage return,
  92. goto again            ; and go try again right away.
  93.  
  94. :GOTMSG
  95. reinput 1 CONNECT               ; Got a message, was it CONNECT?
  96. if success goto done            ; If so, we're done.
  97. reinput 1 BUSY            ; Line is busy.
  98. if success goto busy        ; Go wait a while and then dial again.
  99. reinput 1 ERROR            ; Command syntax error.
  100. if success errfail {Dialing command error}
  101. reinput 1 NO CARRIER        ; Phone didn't answer or no carrier.
  102. if success errfail {No answer or no carrier}
  103. reinput 1 NO DIALTONE        ; No dialtone when phone taken off hook.
  104. if success errfail {No dialtone - Is your modem connected to the phone line\63}
  105. goto getmsg            ; None of the above, get another message.
  106.  
  107. :BUSY
  108. if < \v(count) 2 goto quit    ; Don't wait 30 seconds if tries are used up.
  109. Echo Line is busy, will dial again in 30 seconds
  110. echo Press any key to cancel...
  111. output \13            ; CR cancels dialing
  112. hangup                          ; Hang up.
  113. :AGAIN
  114. if count goto redial            ; Then go redial.
  115. :QUIT
  116. errfail {It never answers!  I give up.} ; Too many tries.
  117.  
  118. :DONE                           ; Connected.
  119. echo \7                         ; Celebrate with a beep.
  120. define errfail            ; Erase local macro definitions...
  121. end 0                ; Finished, return success code.
  122.  
  123. :FAIL                ; Dialing failed, no beep.
  124. define errfail            ; Erase local macro definitions...
  125. end 1                ; Return failure code.
  126.  
  127. ; End of PP14400.SCR
  128.